package com.itheima.commons.model.mongo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;

/**
 * 评论表
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Document(collection = "quanzi_comment")
public class Comment implements Serializable {

    @Id
    private ObjectId id;
    //发布id
    private ObjectId publishId;
    //评论类型，1-点赞，2-评论，3-喜欢
    private Integer commentType;
    //评论内容
    private String content;
    //评论人ID
    private Long userId;
    //发布动态的用户id
    private Long publishUserId;
    //是否为父节点，默认是否
    private Boolean isParent = false;
    // 父节点id
    private ObjectId parentId;
    //发表时间
    private Long created;

}